/*! \file Device.h
 *	\brief <write description for Device.h>
 *
 *	created:	2009/11/13
 *	created:	13:11:2009   16:52
 *	filename: 	c:\src\main\libs\gd_dx9\Device.h
 *	file path:	c:\src\main\libs\gd_dx9
 *	file base:	Device
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _GD_DX9_DEVICE_H_
#define _GD_DX9_DEVICE_H_

#pragma once

#include <d3d9.h>

#include <gd/Device.h>
#include <utils/COMPointer.h>

namespace tt{

namespace app_win{
class Window;
} //namespace app_win

namespace gd_dx9{

class Driver;

class Device : public gd::Device
{
public:
	Device(Driver*, const SharedPtr<app_win::Window>&);
	virtual ~Device(void);

	utils::COMPointer<IDirect3DDevice9>& d3dDevice();

private:
	virtual void onPresent();

	virtual SharedPtr<gd::DeviceContext> onDeviceContext();
	virtual SharedPtr<gd::PrimitiveBuilder> onCreatePrimitiveBuilder();
	virtual SharedPtr<gd::ShaderBuilder> onCreateShaderBuilder();

private:
	utils::COMPointer<IDirect3DDevice9> m_d3dDevice;
};

} //namespace gd_dx9
} //namespace tt

#endif //_GD_DX9_DEVICE_H_
